<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 显示的动画 */
        .bounce-enter-active {
            animation: bounce-in .5s;
        }

        /* 隐藏的动画 */
        .bounce-leave-active {
            animation: bounce-in .5s reverse;
        }

        @keyframes bounce-in {
            0% {
                transform: scale(0);
            }

            50% {
                transform: scale(1.5);
            }

            100% {
                transform: scale(1);
            }
        }
    </style>
</head>

<body>
    <!-- 
        注意：设置动画的元素是块元素宽度默认和父元素一样大
              整个元素都有动画属性，当内容少的时候，就达不到想要的
              效果，所以需要将设置动画的元素改成行内元素
     -->
    <div id="example-2">
        <button @click="show = !show">Toggle show</button><br>
        <transition name="bounce">
            <p v-if="show" style="display:inline-block">Lorem ipsum dolor sit amet
               </transition>
    </div>
    <script src="../day02/js/vue.js"></script>
    <script>
        new Vue({
            el: '#example-2',
            data: {
                show: true
            }
        })
    </script>
</body>

</html>